package com.wxdc.nmgyt.nmgytwydc.activity.common;

import android.content.Context;

import com.wxdc.nmgyt.nmgytwydc.greendao.ope.CodeBeanDaoOpe;
import com.wxdc.nmgyt.nmgytwydc.model.YdCodeBean;

/**
 * Created by Administrator on 2018/10/19.
 */

public class YdInfoCommon {
    private static volatile  YdInfoCommon instance;
    private static Context mContext;
    private YdInfoCommon(){}
    public static YdInfoCommon getInstance(Context context) {
        if (instance == null) {
            synchronized (YdInfoCommon.class) {
                if (instance == null) {
                    mContext = context;
                    instance = new YdInfoCommon();
                }
            }
        }
        return instance;
    }

    /**
     * 动态表单元素
     * @return
     */
    public YdCodeBean getDynamicHtml(){
        YdCodeBean   ydCodeBean = new YdCodeBean();
        //String[] dmlbs = new String[]{"dxdm","px","pw","trlx","zbx","lyfs","lyqd","dlw","lk","ls","fus","fsk","ssg","yjb"};
        ydCodeBean.setDxdm(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"dxdm"));
        ydCodeBean.setPx(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"px"));
        ydCodeBean.setPw(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"pw"));
        ydCodeBean.setTrlx(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"trlx"));
        ydCodeBean.setZbx(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"zbx"));
        ydCodeBean.setLyfs(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"lyfs"));
        ydCodeBean.setLyqd(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"lyqd"));
        ydCodeBean.setDlw(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"dlw"));
        ydCodeBean.setLk(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"lk"));
        ydCodeBean.setLs(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"ls"));
        ydCodeBean.setFus(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"fus"));
        ydCodeBean.setFsk(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"fsk"));
        ydCodeBean.setSsg(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"ssg"));
        ydCodeBean.setYjb(CodeBeanDaoOpe.queryCodeByDmlb(mContext,"yjb"));
        return ydCodeBean;
    }

}
